<?php 
require_once("connect_db.php");
$sqlTeacher="select * from car where status='Y'";
$queryTeacher=mysql_query($sqlTeacher);

$i=0;
while($row = mysql_fetch_array($queryTeacher))
{ 
$arr["text"]=$row["car_brand"]." ".$row["car_model"];
$arr["value"]=$row["car_id"];
$arr["selected"]=false;
if($row["car_geartype"]=="อัตโนมัติ")
$arr["description"]="เกียร์ : ออโต้";
else 
$arr["description"]="เกียร์ : ธรรมดา";
$arr["imageSrc"]="../uploads/car/pics/".$row["car_pic"];
$main_arr[] = $arr;
$i++;
}

$json = json_encode($main_arr);
echo $json;
?>